package com.trkj.pojo;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;


/**
 * The persistent class for the AFFAIRCATEGORY database table.
 * 
 */
@Entity
@NamedQuery(name="Affaircategory.findAll", query="SELECT a FROM Affaircategory a")
public class Affaircategory implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="AFFAIRCATEGORY_AFFCAID_GENERATOR", sequenceName="HR")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="AFFAIRCATEGORY_AFFCAID_GENERATOR")
	@Column(name="AFFCA_ID")
	private long affcaId;

	@Column(name="AFFCA_FOUNDDATE")
	private Timestamp affcaFounddate;

	@Column(name="AFFCA_NAME")
	private String affcaName;

	@Column(name="AFFCA_OVERTIME")
	private String affcaOvertime;

	@Column(name="AFFCA_PERSON")
	private String affcaPerson;

	@Column(name="AFFCA_STATE")
	private BigDecimal affcaState;

	@Column(name="AFFCA_TYPE")
	private String affcaType;

	@Column(name="AFFCA_UPDATE")
	private Timestamp affcaUpdate;

	//bi-directional many-to-one association to Affairtypeconfirm
	@OneToMany(mappedBy="affaircategory")
	@JSONField(serialize=false)
	private List<Affairtypeconfirm> affairtypeconfirms;

	//bi-directional many-to-one association to Confirmaffair
	@OneToMany(mappedBy="affaircategory")
	@JSONField(serialize=false)
	private List<Confirmaffair> confirmaffairs;

	public Affaircategory() {
	}

	public long getAffcaId() {
		return this.affcaId;
	}

	public void setAffcaId(long affcaId) {
		this.affcaId = affcaId;
	}

	public Timestamp getAffcaFounddate() {
		return this.affcaFounddate;
	}

	public void setAffcaFounddate(Timestamp affcaFounddate) {
		this.affcaFounddate = affcaFounddate;
	}

	public String getAffcaName() {
		return this.affcaName;
	}

	public void setAffcaName(String affcaName) {
		this.affcaName = affcaName;
	}

	public String getAffcaOvertime() {
		return this.affcaOvertime;
	}

	public void setAffcaOvertime(String affcaOvertime) {
		this.affcaOvertime = affcaOvertime;
	}

	public String getAffcaPerson() {
		return this.affcaPerson;
	}

	public void setAffcaPerson(String affcaPerson) {
		this.affcaPerson = affcaPerson;
	}

	public BigDecimal getAffcaState() {
		return this.affcaState;
	}

	public void setAffcaState(BigDecimal affcaState) {
		this.affcaState = affcaState;
	}

	public String getAffcaType() {
		return this.affcaType;
	}

	public void setAffcaType(String affcaType) {
		this.affcaType = affcaType;
	}

	public Timestamp getAffcaUpdate() {
		return this.affcaUpdate;
	}

	public void setAffcaUpdate(Timestamp affcaUpdate) {
		this.affcaUpdate = affcaUpdate;
	}

	public List<Affairtypeconfirm> getAffairtypeconfirms() {
		return this.affairtypeconfirms;
	}

	public void setAffairtypeconfirms(List<Affairtypeconfirm> affairtypeconfirms) {
		this.affairtypeconfirms = affairtypeconfirms;
	}

	public Affairtypeconfirm addAffairtypeconfirm(Affairtypeconfirm affairtypeconfirm) {
		getAffairtypeconfirms().add(affairtypeconfirm);
		affairtypeconfirm.setAffaircategory(this);

		return affairtypeconfirm;
	}

	public Affairtypeconfirm removeAffairtypeconfirm(Affairtypeconfirm affairtypeconfirm) {
		getAffairtypeconfirms().remove(affairtypeconfirm);
		affairtypeconfirm.setAffaircategory(null);

		return affairtypeconfirm;
	}

	public List<Confirmaffair> getConfirmaffairs() {
		return this.confirmaffairs;
	}

	public void setConfirmaffairs(List<Confirmaffair> confirmaffairs) {
		this.confirmaffairs = confirmaffairs;
	}

	public Confirmaffair addConfirmaffair(Confirmaffair confirmaffair) {
		getConfirmaffairs().add(confirmaffair);
		confirmaffair.setAffaircategory(this);

		return confirmaffair;
	}

	public Confirmaffair removeConfirmaffair(Confirmaffair confirmaffair) {
		getConfirmaffairs().remove(confirmaffair);
		confirmaffair.setAffaircategory(null);

		return confirmaffair;
	}

}